<?php

namespace App\Http\Controllers;

use Illuminate\Routing\Controller as BaseController;
use Tymon\JWTAuth\Facades\JWTAuth;
use App\Models\Users;

class UserAddressesController extends BaseController
{

    public $UserModel;
    public function __construct()
    {
        $this->UserModel = new Users;
    }  

    public function index()
    {
        $user = JWTAuth::parseToken()->touser();
       
        return view('user_addresses.index', [
            'addresses' => $this->UserModel::find($user->id)->MemberAddress,
        ]);
    }

    // 创建新地址
    public function store()
    {
        
    }

    // 删除
    public function destroy()
    {
        # code...
    }
    
}
